<?php
require_once("classes/Helpers.php");

// remove the magic quotes, because magic quotes f!cking suck
if( get_magic_quotes_gpc () ) {
    if (!empty($_GET))     Helpers::remove_magic_quotes( $_GET );
    //if (!empty($_POST))    Helpers::remove_magic_quotes( $_POST );
    if (!empty($_COOKIE))  Helpers::remove_magic_quotes( $_COOKIE );
    //if (!empty($_REQUEST)) remove_magic_quotes($_REQUEST);
}

try {
    require ("classes/init.php");
  }
catch(Exception $e) {
    echo "Got exception $e\n";
    echo "Exiting.....";
    exit;
}


$sec = $_GET['sec'];

if(!$sec)
    $sec = 'forum';
$PARAPARA->fetch_account();


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="/scripts/mootools.js?t=<? echo time() ?>"></script>
    <script type="text/javascript" src="js/paraforum.js?t=<? echo time() ?>"></script>
    <title>Blok4.dK ~~</title>
    <link rel="stylesheet" href="styles/basic.css" type="text/css" />
    <link rel="stylesheet" href="styles/elements.css" type="text/css" />
  </head>

  <body class="layout-twt">
    <div id="container">
      <div id="container-inner">

        <div id="header">
          <div id="header-inner">
            <div id="header-content">
              <h1 id="header-name">BLOK4.dk</h1>
              <h2 id="header-description">ikke de helt vilde</h2>
    <div id="parabox_login"><? 
    if( $PARAPARA->is_logged_in())
        require "bits/userdata.php";
    else
        require "bits/loginform.php";
            ?></div>
              <? require "bits/top_menu.php" ?>
            </div><!-- header-content end -->
          </div><!-- header-inner end -->
        </div><!-- header end -->

        <div id="banner"><? $PARAPARA->quote_of_the_day(); ?></div>
        <div id="para_status_field"><div id="para_status_field_inner">Me here</div></div>
        <div id="content">
          <div id="content-inner">
            <div id="alpha">
              <div id="alpha-inner">
<div id="parabox_main">
<?php 
    
    $para_load = array();
    $para_load['chat' ] = true;

$para_boxes_left  = array();
$para_boxes_right = array();
if( $sec == 'forum' ) {
    require "bits/forum_index.php";
    $para_load['forum'] = true;

    $para_boxes_right['linkroll'] = true;
    $para_load['linkroll']        = true;
}
elseif($sec == 'linkroll') {
    require "bits/linkroll_index.php";
    $para_load['linkroll'] = true;
}
elseif($sec == 'articles') {
    require "bits/articles_index.php";
    $para_load['forum'] = false;
}
elseif($sec == 'register') {
    require "bits/register_index.php";
    $para_load['forum'] = false;
}
    
?></div>
              </div><!-- alpha-inner end -->
            </div><!-- alpha end -->

            <div id="beta">
              <div id="beta-inner">
<div id="parabox_chat"><? require "bits/chatform.php" ?></div>
              </div><!-- beta-inner end -->
            </div><!-- beta end -->

            <div id="gamma">
              <div id="gamma-inner">
<?
    if($para_boxes_right['linkroll'])
        require "bits/linkroll_box.php";

?>
              </div><!-- gamma-inner end -->
            </div><!-- gamma end -->

          </div><!-- content-inner end -->
        </div><!-- content end-->

        <div id="footer">
          <div id="footer-inner">
            <p>Copyright 14 Stive Betjente 2008</p>
          </div>
        </div><!-- footer end -->

      </div><!-- container-inner end -->
    </div><!-- container end -->

 <div id="parabox_debug">Debugger</div>

<script type="text/javascript">
var para_load = <? echo json_encode( $para_load ) ?>;
</script>

  </body>
</html>
